package tests;

import org.junit.Before;
import org.junit.Test;

import controller.UseCaseController;
import controller.UseCaseControllerImplementation;

public class TestController {

	private UseCaseController useCaseController;
	private static String id;

	@Before
	public void setUp() throws Exception {
		useCaseController = new UseCaseControllerImplementation();
	}

	/**
	 * @After public void tearDown() throws Exception { }
	 * @Test public void testCreateDocument() { List<String> tags = new
	 *       ArrayList<String>(); tags.add("String"); tags.add("Integer");
	 * 
	 *       Revision revision = new Revision("Johannes", "Born", "HelloWorld",
	 *       "String to Integer"); CreateNewDocumentationRequest
	 *       createNewDocumentationRequest = new CreateNewDocumentationRequest(
	 *       revision, "bestpractice", tags); id = useCaseController
	 *       .createNewDocumentation(createNewDocumentationRequest);
	 *       assertNotNull(id); }
	 * @Test public void testAddCommentDocument() { Comment comment = new
	 *       Comment("MyWorld", "Joe", "Born"); CommentDocumentationRequest
	 *       commentDocumentationRequest = new CommentDocumentationRequest( id,
	 *       comment); String response = useCaseController
	 *       .commentDocumentation(commentDocumentationRequest);
	 *       assertEquals("Comment added", response); }
	 * @Test public void testAddRating() { RateDocumentationRequest
	 *       rateDocumentationRequest = new RateDocumentationRequest( id, 3);
	 *       RateDocumentationRequest rateDocumentationRequest2 = new
	 *       RateDocumentationRequest( id, 5); String response =
	 *       useCaseController .rateDocumentation(rateDocumentationRequest);
	 *       assertEquals("Document rated", response); String response2 =
	 *       useCaseController .rateDocumentation(rateDocumentationRequest2);
	 *       assertEquals("Document rated", response2); }
	 * @Test public void testAddRevision() { Revision revision = new
	 *       Revision("Emeröz", "Sinem", "whatever", "helloKiddy");
	 *       EditDocumentationRequest editDocumentationRequest = new
	 *       EditDocumentationRequest( id, revision, new ArrayList<String>());
	 *       String response = useCaseController
	 *       .editDocumentation(editDocumentationRequest);
	 *       assertEquals("Document edited", response); }
	 * @Test public void testReadNoEntrys() { ReadDocumentationRequest request =
	 *       new ReadDocumentationRequest( "bestpractice", "string");
	 *       List<ReadDocumentationResponse> list = useCaseController
	 *       .readDocumentation(request); assertTrue(list.isEmpty()); }
	 * @Test public void testSearchRevision() { List<String> tags = new
	 *       ArrayList<String>(); tags.add("String");
	 *       List<SearchRevisionResponse> list = useCaseController
	 *       .searchRevision(new SearchRevisionRequest(tags)); }
	 */
	@Test
	public void testCreateAndEditDocumentation() {

		// String ID = useCaseController.createNewDocumentation(
		// new CreateNewDocumentationRequest(
		// new EditDocumentationRevision("", "", "dies ist ein test",
		// "test für haeder"), "bestpractice", Arrays.asList(new
		// String[]{"java.lang.String"})));
		// assertEquals("Document edited"
		// ,useCaseController.editDocumentation(new EditDocumentationRequest(ID,
		// new EditDocumentationRevision("", "", "dies ist ein test edit",
		// "test für haeder"), Arrays.asList(new
		// String[]{"","java.lang.String"}))));
	}
}
